.class Lcom/htc/android/footprints/activity/SearchActivity$4;
.super Ljava/lang/Object;
.source "SearchActivity.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/htc/android/footprints/activity/SearchActivity;->onCreateDialog(I)Landroid/app/Dialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/htc/android/footprints/activity/SearchActivity;


# direct methods
.method constructor <init>(Lcom/htc/android/footprints/activity/SearchActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 231
    iput-object p1, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 7
    .parameter "dialog"
    .parameter "which"

    .prologue
    .line 232
    packed-switch p2, :pswitch_data_0

    .line 258
    :goto_0
    invoke-interface {p1}, Landroid/content/DialogInterface;->dismiss()V

    .line 259
    return-void

    .line 234
    :pswitch_0
    new-instance v2, Landroid/content/Intent;

    const-string v3, "com.htc.android.footprints.activity.FootprintDetailEditActivity"

    invoke-direct {v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 237
    .local v2, intent:Landroid/content/Intent;
    :try_start_0
    const-string v3, "DATA"

    iget-object v4, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    #getter for: Lcom/htc/android/footprints/activity/SearchActivity;->mSelectedFootprint:Lcom/htc/android/footprints/vo/Footprint;
    invoke-static {v4}, Lcom/htc/android/footprints/activity/SearchActivity;->access$600(Lcom/htc/android/footprints/activity/SearchActivity;)Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 239
    iget-object v3, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    invoke-virtual {v3, v2}, Lcom/htc/android/footprints/activity/SearchActivity;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 240
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 241
    .local v0, ex:Ljava/lang/Exception;
    const-string v3, "SearchActivity"

    const-string v4, "Disable to launch edit mode"

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 245
    .end local v0           #ex:Ljava/lang/Exception;
    .end local v2           #intent:Landroid/content/Intent;
    :pswitch_1
    iget-object v3, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    const/4 v4, 0x2

    invoke-virtual {v3, v4}, Lcom/htc/android/footprints/activity/SearchActivity;->showDialog(I)V

    goto :goto_0

    .line 248
    :pswitch_2
    const/4 v3, 0x1

    new-array v1, v3, [Lcom/htc/android/footprints/vo/Footprint;

    const/4 v3, 0x0

    iget-object v4, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    #getter for: Lcom/htc/android/footprints/activity/SearchActivity;->mSelectedFootprint:Lcom/htc/android/footprints/vo/Footprint;
    invoke-static {v4}, Lcom/htc/android/footprints/activity/SearchActivity;->access$600(Lcom/htc/android/footprints/activity/SearchActivity;)Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v4

    aput-object v4, v1, v3

    .line 249
    .local v1, footprints:[Lcom/htc/android/footprints/vo/Footprint;
    iget-object v3, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    iget-object v4, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    #getter for: Lcom/htc/android/footprints/activity/SearchActivity;->mSelectedFootprint:Lcom/htc/android/footprints/vo/Footprint;
    invoke-static {v4}, Lcom/htc/android/footprints/activity/SearchActivity;->access$600(Lcom/htc/android/footprints/activity/SearchActivity;)Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v4

    iget-object v4, v4, Lcom/htc/android/footprints/vo/Footprint;->mName:Ljava/lang/String;

    const-string v5, " "

    const-string v6, "_"

    invoke-virtual {v4, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4, v1}, Lcom/htc/android/footprints/utils/FootprintUtils;->exportKMZ(Landroid/app/Activity;Ljava/lang/String;[Lcom/htc/android/footprints/vo/Footprint;)V

    goto :goto_0

    .line 253
    .end local v1           #footprints:[Lcom/htc/android/footprints/vo/Footprint;
    :pswitch_3
    iget-object v3, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    invoke-virtual {v3}, Lcom/htc/android/footprints/activity/SearchActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    iget-object v4, p0, Lcom/htc/android/footprints/activity/SearchActivity$4;->this$0:Lcom/htc/android/footprints/activity/SearchActivity;

    #getter for: Lcom/htc/android/footprints/activity/SearchActivity;->mSelectedFootprint:Lcom/htc/android/footprints/vo/Footprint;
    invoke-static {v4}, Lcom/htc/android/footprints/activity/SearchActivity;->access$600(Lcom/htc/android/footprints/activity/SearchActivity;)Lcom/htc/android/footprints/vo/Footprint;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/htc/android/footprints/utils/FootprintUtils;->saveAsContacts(Landroid/content/Context;Lcom/htc/android/footprints/vo/Footprint;)V

    goto :goto_0

    .line 232
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method
